#include<stdio.h>
#include<unistd.h>
#include<signal.h>
#include<stdio.h>
#include<stdlib.h>

int main(int argc, char *argv[])
{
  sigset_t set,pendset;
  struct sigaction action;
  sigemptyset(&set);
  sigprocmask(SIG_BLOCK,&set,NULL);
  kill(getpid(),SIGTERM);
  sigpending(&pendset);

  if(sigismember(&pendset,SIGTERM))
    {
      printf("yes, The SIGTERM is here\n");
      sigemptyset(&action.sa_mask);
      action.sa_handler = SIG_IGN;
      sigaction(SIGTERM,&action,NULL);
    }
  sigprocmask(SIG_UNBLOCK,&set,NULL);
  exit(EXIT_SUCCESS);
  return 0;
}
